var testConfig = require('../testConfig');
function TestProject() {
  this.init = function () {
    var arr = [];
    arr.push(
      this.step1,
      this.step2,
      this.step3,
      this.step4,
      this.step5,
      this.step6,
      this.step7,
      this.step8,
      this.step9,
      this.step10,
      this.step11,
      this.step12,
      this.step13,
      this.step14
    );
    testConfig.testFun.runStep(arr);
  };
  var uploadImg = "http://choosefine-uat.oss-cn-hangzhou.aliyuncs.com/shopping/user/20170704140050ninZMbBaTs.jpg";
  this.step1 = function () {
    $("#aside-nav").find("div.coords").eq(2).find("a")[0].click();
  };
  this.step2 = function () {
    testConfig.testFun.ai().find("input[data-name='projectName']").val("姬自动化测试");
  };
  this.step3 = function () {
    testConfig.testFun.ai().find("#teamCapitalBtn").click();
  };
  this.step4 = function () {
    testConfig.testFun.ai().find("tr[data-index='0'] td")[0].click();
  };
  this.step5 = function () {
    testConfig.testFun.bi().find("#editProjectInfo").click();
  };
  this.step6 = function () {
    testConfig.testFun.ci().find("li.toEditProjectMerchants a")[0].click();
  };
  this.step7 = function () {
    testConfig.testFun.ci().find(".addMerchants")[0].click();
  };
  this.step8 = function () {
    testConfig.testFun.di().find("#selMater").html("<option value='7'>设备供应商</option>");
  };
  this.step9 = function () {
    testConfig.testFun.di().find("#idorName").val("供应商");
  };
  this.step10 = function () {
    testConfig.testFun.di().find("#query").click();
  };
  this.step11 = function () {
    testConfig.testFun.di().find("tr[data-index='2'] td").click();
  };
  this.step12 = function () {
    testConfig.testFun.di().find("#wrap_a img").attr("src", uploadImg);
  };
  this.step13 = function () {
    testConfig.testFun.di().find("#tipYes").click();
  };
  this.step14 = function () {
    testConfig.testFun.ci().find(".finish")[0].click();
  };
}
function testStart() {
  var test = new TestProject();
  test.init();
}
exports.start = testStart;
